package rs.etf.kdp.server;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Result implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7197547431078449933L;

	private int needParts;
	private int inParts;
	private List<String[][]> results;
	
	public Result(int numberOfPartsNeeded)
	{
		needParts = numberOfPartsNeeded;
		inParts = 0;
		results = new ArrayList<String[][]>();
	}
	
	public boolean isCompleted()
	{
		if (inParts==needParts) return true;
		else return false;
	}
	
	public void insertResult(String[][] res)
	{
		if(isCompleted()) return;
		results.add(res);
		inParts++;
	}

	public int getNeedParts() {
		return needParts;
	}

	public void setNeedParts(int needParts) {
		this.needParts = needParts;
	}

	public int getInParts() {
		return inParts;
	}

	public void setInParts(int inParts) {
		this.inParts = inParts;
	}

	public List<String[][]> getResults() {
		return results;
	}

	public void setResults(List<String[][]> results) {
		this.results = results;
	}
}
